package com.jcompressor;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.Serializable;

public class DataStream implements Serializable {
	
	private static final long serialVersionUID = 1600074300424145790L;
	private final PrintStream output;
	private final BufferedReader reader;
	
	public DataStream() {
		this.output = System.out;
		this.reader = new BufferedReader(new InputStreamReader(System.in));
	}
	
	public BufferedReader getReader() {
		return this.reader;
	}
	
	public void empty() {
		this.output.println();
	}
	
	public void info(final Object message) {
		this.output.println(message);
	}
	
	public void print(final Object message) {
		this.output.print(message);
	}
	
	public void error(final String message) {
		this.info(message + " :(");
		this.flush();
		this.exit();
	}
	
	public void flush() {
		this.output.flush();
	}
	
	public void exit() {
		System.exit(0);
	}
	
}